<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.biz.utils.ConfigUtil" %>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
    String resoursUrl = ConfigUtil.get("RESOURCES_URL");
%>

<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>久零券明细</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="<%=resoursUrl%>resources/assets/css/dxy.css" />
  <jsp:include page="/jsp/inc_head.jsp"></jsp:include>
	<script>
		$(document).ready(function(){
			var maxheight = $(window).height() - 78 - 53 - 40 ;
			$(".am-tabs-bd").css("max-height",maxheight);
		})

	</script>
<style>

	.am-tabs-bd {
		border-width: 0;
		border-style: solid;
		border-color: #b9c0cf;
		border-radius:0 0 2px 2px;
		background-color:#fff;
		max-height:;
		overflow-y:auto;
	}
	[data-am-widget=tabs] {
		margin:0;
	}
	.am-tabs-d2 .am-tabs-nav>.am-active a {
		color: #fff;
	}
	.am-tabs-d2 .am-tabs-nav>.am-active {
		border-bottom:0;
		background-color: #ff4c00;
	}
	.am-tabs-d2 .am-tabs-nav {
		background-color: #fff;
		border-bottom: 1px solid #b9c0cf;
	}
	.am-tabs-bd .am-tab-panel {
		padding:0;
	}
	.am-tabs-d2 .am-tabs-nav li {
		height: inherit;
		padding: 6px 0;
	}
	.am-tabs-d2 .am-tabs-nav>.am-active:after {
		bottom: -2px;
		border-bottom-color: #b9c0cf;
	}

</style>
</head>
<body class="grzxbody" style="background: #fff;">
<div class="am-g getsentNunm">
	<div class="am-u-sm-12 jfdh_top" style="border:1px solid #f2f2f2;">
		<div class="am-u-sm-8 am-pad-none" onclick="toDetail()">
			<img src="<%=resoursUrl%>resources/assets/image/icon_wenhao.png" width="16" style="margin-top:-3px;"/>&nbsp;&nbsp;点击了解久零券
		</div>
		<div class="am-u-sm-4 am-pad-none am-text-right">
			<img src="<%=resoursUrl%>resources/assets/image/icon_right.png"/>
		</div>
	</div>
</div>

<div class="am-g getsentNunm1">
	<div data-am-widget="tabs" class="am-tabs am-tabs-d2" style="border:1px solid #f2f2f2;">
		<ul class="am-tabs-nav am-cf">
			<li class="am-active">
				<a href="[data-tab-panel-0]">
					<div class="ljjf">
						<span class="ljjf_txt">领取数额</span><br/>
						<span class="ljjf_num" id="lqje">0.00</span>
					</div>
				</a>
			</li>
			<li class="">
				<a href="[data-tab-panel-1]">
					<div class="ljjf">
						<span class="ljjf_txt">消费数额</span><br/>
						<span class="ljjf_num" id="xfje">0.00</span>
					</div>
				</a>
			</li>
		</ul>
		<div class="am-tabs-bd">
			<div data-tab-panel-0 class="am-tab-panel am-active" id="list_lqje">
			</div>

			<div data-tab-panel-1 class="am-tab-panel" id="list_xfje">
			</div>

		</div>
	</div>
</div>
<!--footer-->
<%--<jsp:include page="/jsp/inc_bottom.jsp"></jsp:include>--%>
<!--footer-->
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
	<div class="am-modal-dialog">
		<div class="am-modal-hd" id="alert_title">哎呦喂，出错啦</div>
		<div class="am-modal-bd" id="alert_message"></div>
		<div class="am-modal-footer">
			  <span class="am-modal-btn">确定</span>
		</div>
	</div>
</div>
<script>
	var ajaxpath="${pageContext.request.contextPath}";
	var pageIn=1;
	var pageOut=1;
    var ajaxpath="${pageContext.request.contextPath}";
	$(function () {

		loadDetailIn(1);
		loadDetailOut(1);
	});
	
	function loadDetailIn (page) {
		//查询用户信息
		var url=ajaxpath+"/userCenter/getDetail90In.do?page="+page;
		$.get(url,function(data){
			if(data.return_data!=null&&data.return_data!=undefined&&data.return_data.length>0)
			{
				var html='';
				for(var i=0;i<data.return_data.length;i++)
				{
					if(data.return_data[i].point_90!=undefined&&data.return_data[i].point_90!=null) {
						if(data.return_data[i].business_name==undefined||data.return_data[i].business_name==null)
						{data.return_data[i].business_name='';}
						html += '<div class="am-u-sm-12 jfdh_list1">';
						html += '<div class="am-u-sm-7 am-pad-none">';
						html += '<div class="jf_date">' + data.return_data[i].create_time + '</div>';
						var money =data.return_data[i].point_90;
						if( parseFloat(money)<0)
						{money=0 - parseFloat(data.return_data[i].point_90);}
						money = (money / 100).toFixed(2);
						if (data.return_data[i].source == 5) {
							html += '<div class="jf_money">' + data.return_data[i].business_name + ':' + data.return_data[i].source_msg + '</div>';
						}
						else {

							html += '<div class="jf_money">' + data.return_data[i].business_name + '消费' +money + '券</div>';
						}

						html += '</div>';
						html += '<div class="am-u-sm-5 am-pad-none am-text-right">';
						html += '<div class="jd_pldiv"><span class="jf_plus">+' + money + '</span>&nbsp;&nbsp;</div>'
						html += '</div></div>';
					}
				}
				var moneyAll=data.return_data[data.return_data.length-1].int_sum;
             //   alert("in"+moneyAll);
				if(parseFloat(moneyAll)<0)
				{moneyAll=0-parseFloat(moneyAll);}
                moneyAll=(moneyAll/100).toFixed(2);
                $("#lqje").html(moneyAll);
				$("#list_lqje").append(html);
			}
		});
	}
	function loadDetailOut (page) {
		//查询用户信息
		var url=ajaxpath+"/userCenter/getDetail90Oout.do?page="+page;
		$.get(url,function(data){
			if(data.return_data!=null&&data.return_data!=undefined&&data.return_data.length>0)
			{var html='';
				for(var i=0;i<data.return_data.length;i++)
				{
					if(data.return_data[i].point_90!=undefined&&data.return_data[i].point_90!=null) {
						if(data.return_data[i].business_name==undefined||data.return_data[i].business_name==null)
						{data.return_data[i].business_name='';}
						html += '<div class="am-u-sm-12 jfdh_list1">';
						html += '<div class="am-u-sm-7 am-pad-none">';
						html += '<div class="jf_date">' + data.return_data[i].create_time + '</div>';
						var money =data.return_data[i].point_90;
						if( parseFloat(money)<0)
						{money=0 - parseFloat(data.return_data[i].point_90);}
						money = (money / 100).toFixed(2);
						if (data.return_data[i].source == 5) {
							html += '<div class="jf_money">' + data.return_data[i].business_name + ':' + data.return_data[i].source_msg + '退款</div>';
						}
						else {

							html += '<div class="jf_money">' + data.return_data[i].business_name + '消费' + money + '券</div>';
						}

						html += '</div>';
						html += '<div class="am-u-sm-5 am-pad-none am-text-right">';
						html += '<div class="jd_pldiv"><span class="jf_plus">-' + money + '</span>&nbsp;&nbsp;</div>'
						html += '</div></div>';
					}
				}
                var moneyAll=data.return_data[data.return_data.length-1].out_sum;
				if( parseFloat(moneyAll)<0)
				{moneyAll=0- parseFloat(moneyAll);}
              //  alert("out"+moneyAll);
                moneyAll=(moneyAll/100).toFixed(2);
                $("#xfje").html(moneyAll);
				$("#list_xfje").append(html);
			}
		});
	}



	/*****加载商品信息--------开始****************/
	/** 下拉时调用 再次加载*/
	$(window).scroll(function()
	{
		/* console.log('top=' + $(window).scrollTop());
		 console.log('height=' + $(window).height());
		 console.log('documenth=' + $(document).height()); */
		if (($(window).scrollTop() + $(window).height() >= $(document).height()- 50)
		)
		{
			pageIn++;
			pageOut++;
			loadDetailIn(pageIn);
			loadDetailOut(pageOut);
		}
	});

    function toDetail(){
        window.location.href = ajaxpath+"/jsp/client/user_question.jsp?guid="+ new Date();
    }
</script>
</body>
</html>
